<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>复选框多选</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>
<body>
    <div id="app">
        <h1>{{checkbox}}</h1>
        <input type="checkbox" id="apple" value="苹果" v-model="checkbox">
        <label for="apple">苹果</label>
        <input type="checkbox" id="banana" value="香蕉" v-model="checkbox">
        <label for="banana">香蕉</label>
        <input type="checkbox" id="orange" value="橙子" v-model="checkbox">
        <label for="orange">橙子</label>
       
    </div>
    <script>
       var app = new Vue({
           el:"#app",
           data:{
            //    为数组时 选择的是value值  ""字符串时选择的是true false同时选中或不选中
            checkbox:[]
           }
       });
    </script>
</body>
</html>